// 设备平台系统信息

// 状态栏信息
const SYSTEM_INFO = uni.getSystemInfoSync()

// 获取状态栏高度
export const getStatusBarHeight = () => {
  return SYSTEM_INFO.statusBarHeight || 15
}
 
// 获取导航标题高度
export const getTitleBarHeight = () => {
  // 判断是否有胶囊按钮
  if (uni.getMenuButtonBoundingClientRect) {
    let { top, height } = uni.getMenuButtonBoundingClientRect()
    let titleBarHeight = (top - getStatusBarHeight()) * 2 + height
    return titleBarHeight
  } else {
    return 40
  }
}

// 获取导航栏整体高度
export const getNavBarHeight = () => {
  return getTitleBarHeight() + getStatusBarHeight()
}